<?php

/**
 * log actions.
 *
 * @package    sf_sandbox
 * @subpackage log
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class logActions extends sfActions
{

  public function preExecute()
  {
    $this->aluCriteria = aluCriteria::buildFromRequest($this->getRequest());
  }

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeList(sfWebRequest $request)
  {
    $this->logs        = LogPeer::doSelect($this->aluCriteria);
    $this->hasGroupage = false;
    $filtres           = $this->getRequest()->getParameter('filtres');
    if ($request->hasParameter('filtres') && array_key_exists('grouper', $filtres) && $filtres['grouper'] != 0)
    {
      $groupage = array();
      switch($filtres['grouper'])
      {
        //TODO changer type
        case 1:
          $this->typegroupage = 'machine';
          break;
        case 2:
          $this->typegroupage = 'utilisateur';
          break;
      }
      $this->hasGroupage = true;
    }

  }
}
